<?php
  require_once(dirname(__FILE__)."/../include/admin/link_data.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <title>链接管理</title>
</head>
<body>
  <div style="padding-left:30px">
    <h2>添加链接</h2>
    <form action="#" method="post" >
      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>标题：</td>
          <td>
            <input type="text" name="title" style="width:500px" />
          </td>
        </tr>
        <tr>
          <td>Src：</td>
          <td>
            <input type="text" name="src" style="width:500px" />
          </td>
        </tr>
        <tr>
          <td></td>
          <td>
            <input type="submit" value="添加" name="add" />
          </td>
        </tr>
      </table>
    </form>
    <br />
    <br />
    <h2>管理链接</h2>
    <table style="width:80%;" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <th style="padding-left:10px">用户名</th>
        <th style="padding-left:10px">时间</th>
        <th style="padding-left:10px">IP</th>
        <th style="padding-left:10px">链接</th>
        <th style="padding-left:10px">操作</th>
      </tr>
      <?php foreach($PageArray["linklist"] as $Object){ ?>
      <form action="#" method="post" >
        <tr >
          <td style="padding-left:10px">
            <input type="hidden" name="id" value="<?php echo $Object->id; ?>" />
            <?php echo $Object->user;?></td>
          <td  style="padding-left:10px">
            <?php echo $Object->time;?></td>
          <td style="padding-left:10px">
            <?php echo $Object->ip;?></td>
          <td style="padding-left:10px">
           <a href="<?php echo $Object->src;?>"><?php echo $Object->title;?></a></td>
          <td style="padding-left:10px">
            <input type="submit" value="删除" name="delete" />
          </td>
        </tr>
      </form >
      <?php }?>
    </table>
  </div>
</body>
</html>